/////////////////////////////////////////////////////////////////////////////////////////////
//
//    Copyright (C) 2009-2014 Microview Science & Technology Co.,Ltd. All Rights Reserved.
//
//    Module:    MVC_Common.H
//
//    Abstract:  Header file for MVCAPI.DLL
//
//    Ver:       1.1.1.1
//
//    Date:      2009.08.11
//
//    Build:     2014.05.09
//
/////////////////////////////////////////////////////////////////////////////////////////////

#ifndef  __MVCAPI__
#define  __MVCAPI__

#include "MVC_Common.h"
#include <vfw.h>

#ifdef __cplusplus
#define MVCAPI extern "C" __declspec (dllexport)
#else
#define MVCAPI __declspec (dllexport)
#endif

MVCAPI DWORD WINAPI MVC_GetDeviceNumber();
MVCAPI MVC_TYPE WINAPI MVC_GetCameraType(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_SetNetPacketSize(DWORD CardNo,DWORD PacketSize); 
MVCAPI DWORD WINAPI MVC_SetNetSendingMode(DWORD CardNo,BOOL m_bMultiCast,char *MultiCastAddress); 
MVCAPI DWORD WINAPI MVC_ReScanDevice();
MVCAPI DWORD WINAPI MVC_FindDevice(char *MACAddress);
MVCAPI DWORD WINAPI MVC_OpenDevice(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_CloseDevice(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_SetParameter(DWORD CardNo,MVC_PARAMTER Oper,DWORD Val );
MVCAPI DWORD WINAPI MVC_GetParameter(DWORD CardNo,MVC_PARAMTER Oper);
MVCAPI DWORD WINAPI MVC_GetParameterEx(DWORD CardNo,MVC_PARAMTER Oper,LPDWORD Val);
MVCAPI DWORD WINAPI MVC_GetDeviceInfo(DWORD CardNo,MVCGE_DEVLIST *DevList);
MVCAPI DWORD WINAPI MVC_GetDeviceInfoEx(DWORD CardNo,MVCGE_DEVLISTEX *DevList);
MVCAPI DWORD WINAPI MVC_SetDeviceInfo(DWORD CardNo,DEVICE_INFO DevInfo,char *InfoStr);
MVCAPI DWORD WINAPI MVC_GetDeviceStat(DWORD CardNo,MVCDEVSTATE *DevStat);
MVCAPI DWORD WINAPI MVC_GetErrorInfo(DWORD CardNo,char *ErrInfoStr);
MVCAPI DWORD WINAPI MVC_GetBadImageCount(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_GetAdpaterInfo(DWORD CardNo,MVCGE_ADAPTERLIST *AdpList);
MVCAPI DWORD WINAPI MVC_EnableCapture(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_DisableCapture(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_GetRawData(DWORD CardNo,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_GetRgbData(DWORD CardNo,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_GetGRAYData(DWORD CardNo,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_PixelConverter(DWORD CardNo,PMVCFRAMEINFO RAWFrameInfo,PMVCFRAMEINFO RGBFrameInfo,BOOL ConverterFlag);
MVCAPI DWORD WINAPI MVC_SetStreamHOOK(DWORD CardNo,StreamProc lpStreamFun,PVOID pUserData);
MVCAPI DWORD WINAPI MVC_GetRgbData2(DWORD CardNo,PMVCFRAMEINFO RGBFrameInfo);
MVCAPI DWORD WINAPI MVC_PixelConverter2(DWORD CardNo,PMVCFRAMEINFO RAWFrameInfo,PMVCFRAMEINFO RGBFrameInfo,BOOL ConverterFlag);
MVCAPI DWORD WINAPI MVC_GetRgbData3(DWORD CardNo,PMVCFRAMEINFO RGBFrameInfo);
MVCAPI DWORD WINAPI MVC_PixelConverter3(DWORD CardNo,PMVCFRAMEINFO RAWFrameInfo,PMVCFRAMEINFO RGBFrameInfo,BOOL ConverterFlag);
MVCAPI DWORD WINAPI MVC_ConvertRgbToBw(DWORD CardNo,PMVCFRAMEINFO RGBFrameInfo,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_StartCaptureToFlashMemory(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_StopCaptureToFlashMemory(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_GetSingleFrameFromFlashMemory(DWORD CardNo,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_DispWinMoveMsg(DWORD CardNo,DWORD Posx,DWORD PosY);
MVCAPI DWORD WINAPI MVC_DispWinResizeMsg(DWORD CardNo,DWORD Width,DWORD Height);
MVCAPI DWORD WINAPI MVC_DispWinPaintMsg(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_DispWinCloseMsg(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_DispZoomIn(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_DispZoomOut(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_DispZoomFit(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_DispZoomRatio(DWORD CardNo,double aRatio);
MVCAPI DWORD WINAPI MVC_GetDispZoomRatio(DWORD CardNo,double& aRatio);
MVCAPI DWORD WINAPI MVC_DispMove(DWORD CardNo,int  aTransX,int  aTransY);
MVCAPI DWORD WINAPI MVC_DispCenter(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_DispCenterLock(DWORD CardNo,bool aLocked);
MVCAPI DWORD WINAPI MVC_GetDispCenterLock(DWORD CardNo,bool &aLocked);
MVCAPI DWORD WINAPI MVC_SetDispWinBackgroundColor(DWORD CardNo,unsigned char aRed,unsigned char aGreen,unsigned char aBlue);
MVCAPI DWORD WINAPI MVC_GetDispWinBackgroundColor(DWORD CardNo,unsigned char &aRed,unsigned char &aGreen,unsigned char &aBlue);
MVCAPI DWORD WINAPI MVC_SetDispWinTitle(DWORD CardNo,char *TitleName);
MVCAPI DWORD WINAPI MVC_DispRawData(DWORD CardNo,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_DispRGBData(DWORD CardNo,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_SaveFile(DWORD CardNo,FILE_FORMT FTYPE,PMVCFRAMEINFO FrameInfo,char *FileName,BOOL IsUpDown,BOOL ColororNot,ULONG Quality,BOOL m_bRGB15TO24Mode);
MVCAPI DWORD WINAPI MVC_SaveAVIName(DWORD CardNo,char *FileName,COMPVARS *mCOMPVARS);
MVCAPI DWORD WINAPI MVC_SelectFilterAndSetAVIName(DWORD CardNo,char *FileName);
MVCAPI DWORD WINAPI MVC_StartVideoCompressor(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_StartVideoCompressorEx(DWORD CardNo,DWORD Width,DWORD Height,DWORD PixelBytes,double FrameRate);
MVCAPI DWORD WINAPI MVC_StopVideoCompressor(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_CompressorFrame(DWORD CardNo,void *aBuffer,DWORD BufSize);
MVCAPI DWORD WINAPI MVC_InitDisplay(DWORD CardNo,HWND hWnd,COLORREF crColorKey,DWORD dwWidth,DWORD dwHeight,DISPCOLORFMT ColorFmt,int DispFlip,DISPMethod DispMethod,BOOL AutoModify);
MVCAPI DWORD WINAPI MVC_DisplayData(DWORD CardNo,LPBYTE buffer,DWORD BufSize,RECT rcDest,BOOL GDIMODE);
MVCAPI DWORD WINAPI MVC_DisplayDataEx(DWORD CardNo,LPBYTE buffer,DWORD BufSize,DWORD BufWidth,DWORD BufHeight,LPRECT rcDest,LPRECT rcSrc);
MVCAPI DWORD WINAPI MVC_FiniDisplay(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_SetDispSourceRect(DWORD CardNo,RECT rcSrc);
MVCAPI DWORD WINAPI MVC_SetDispGDIText(DWORD CardNo,DWORD StrNo,DWORD PosX,DWORD PosY,DWORD TextColor,PCHAR pStr,HFONT TextFont);
MVCAPI DWORD WINAPI MVC_SetDispGDIGraph(DWORD CardNo,DWORD GraphNo,GRAPHMODE Line_Arc,DWORD Pos0X,DWORD Pos0Y,DWORD Pos1X,DWORD Pos1Y,HPEN GDIPen);
MVCAPI DWORD WINAPI MVC_SetDispGDICanCalOne(DWORD CardNo,GRAPHMODE Line_Arc,DWORD No);
MVCAPI DWORD WINAPI MVC_SetDispCanCalAll(DWORD CardNo,GRAPHMODE Line_Arc);
MVCAPI DWORD WINAPI MVC_SerialSendData(DWORD CardNo,PMVCGE_SERIALCONFIG SerCon,PBYTE DataBuf,DWORD SendByteNum);
MVCAPI DWORD WINAPI MVC_SerialReceiveData(DWORD CardNo,PMVCGE_SERIALCONFIG SerCon,PBYTE DataBuf,DWORD ReceiveByteNum);
MVCAPI DWORD WINAPI MVC_SerialSendReceiveData(DWORD CardNo,PMVCGE_SERIALCONFIG SerCon,PBYTE SDataBuf,DWORD SendByteNum,PBYTE RDataBuf,PDWORD ReceiveByteNum);
MVCAPI DWORD WINAPI MVC_SaveNoisePixel(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_LoadNoisePixel(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_DetectNoisePixel(DWORD CardNo,PULONG NoisePixelNum,BYTE NoiseFlag);
MVCAPI DWORD WINAPI MVC_RemoveNoisePixel(DWORD CardNo,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_AutoWhiteBalance(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_WhiteBalance(DWORD CardNo,LPRECT WinRect);
MVCAPI DWORD WINAPI MVC_AutoWhiteBalanceTarget(DWORD CardNo,BYTE m_btRTarget,BYTE m_btGTarget,BYTE m_btBTarget);
MVCAPI DWORD WINAPI MVC_AutoExposure(DWORD CardNo,BYTE m_btAETarget);
MVCAPI DWORD WINAPI MVC_SetGPIOHOOK(DWORD CardNo,GPIOProc lpControlFun,PVOID pUserData);
MVCAPI DWORD WINAPI MVC_SetTTL_SWCTRL(DWORD CardNo,BYTE Bit,BOOL Stat);
MVCAPI DWORD WINAPI MVC_GetTTL_USERINPUT(DWORD CardNo,DWORD *SWCTRLStat,DWORD *TTLIN);
MVCAPI DWORD WINAPI MVC_SetGPIOLUT(DWORD CardNo,PMVCGE_GPIOLUTPARAM pGPIOLUT);
MVCAPI DWORD WINAPI MVC_GetGPIOLUT(DWORD CardNo,PMVCGE_GPIOLUTPARAM pGPIOLUT);
MVCAPI DWORD WINAPI MVC_SetGPIOLUTProgram(DWORD CardNo,char *ProgramStr);
MVCAPI DWORD WINAPI MVC_GetGPIOLUTProgram(DWORD CardNo,char *ProgramStr);
MVCAPI DWORD WINAPI MVC_SetPulseGenParam(DWORD CardNo,BYTE PulseGenNo,PMVCGE_PULSEGENPARAM pPULSEGEN);
MVCAPI DWORD WINAPI MVC_GetPulseGenParam(DWORD CardNo,BYTE PulseGenNo,PMVCGE_PULSEGENPARAM pPULSEGEN);
MVCAPI DWORD WINAPI MVC_AddGrabBuffer(DWORD CardNo,DWORD BufID,PBYTE PBuf,DWORD BufSize);
MVCAPI DWORD WINAPI MVC_DelGrabBuffer(DWORD CardNo,DWORD BufID);
MVCAPI DWORD WINAPI MVC_GrabSingleFrameNoWait(DWORD CardNo,DWORD BufID);
MVCAPI DWORD WINAPI MVC_WaitGrabSingleFrameEvent(DWORD CardNo,DWORD BufID,double *lFrameRate);
MVCAPI DWORD WINAPI MVC_StartContinuous(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_StopContinuous(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_SaveConfigFile(DWORD CardNo,char *FileName);
MVCAPI DWORD WINAPI MVC_LoadConfigFile(DWORD CardNo,char *FileName);
MVCAPI DWORD WINAPI MVC_SetCSUSTVal(DWORD CardNo,DWORD Index,DWORD Val);
MVCAPI DWORD WINAPI MVC_GetCSUSTVal(DWORD CardNo,DWORD Index,DWORD *Val);
MVCAPI DWORD WINAPI MVC_EnableVirtualSerialPort(DWORD CardNo,BYTE mSystemPort,BYTE mBitSize,BYTE mBaudRate,BYTE mStopBits,BYTE mParity);
MVCAPI DWORD WINAPI MVC_DisableVirtualSerialPort(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_SetDevLostHOOK(DWORD CardNo,DevLostProc lpLostFun,PVOID pUserData);
MVCAPI DWORD WINAPI MVC_SetPGParam(DWORD CardNo,BYTE PulseGenNo,PMVCGE_LINESCAN_PULSEGENPARAM pPULSEGEN);
MVCAPI DWORD WINAPI MVC_GetPGParam(DWORD CardNo,BYTE PulseGenNo,PMVCGE_LINESCAN_PULSEGENPARAM pPULSEGEN);
MVCAPI DWORD WINAPI MVC_ConvertWordToByte(DWORD CardNo,PMVCFRAMEINFO SrcFrameInfo,PMVCFRAMEINFO DstFrameInfo,BYTE ShiftValue);
MVCAPI DWORD WINAPI MVC_SetGamma(DWORD CardNo,BYTE *pGamma,BOOL bGamma);
MVCAPI DWORD WINAPI MVC_SetGammaValue(DWORD CardNo,float fGammaValue,BOOL bGammaOn);
MVCAPI DWORD WINAPI MVC_GetGammaValue(DWORD CardNo,float *fGammaValue,BOOL *bGamma);
MVCAPI DWORD WINAPI MVC_USEGammaLUT(DWORD CardNo,PMVCFRAMEINFO SrcInfo);
MVCAPI DWORD WINAPI MVC_SetCamera_SoftFrameRate(DWORD CardNo,DWORD FrameRate,DWORD IntTime);
MVCAPI DWORD WINAPI MVC_GetCamera_SoftFrameRate(DWORD CardNo,DWORD *FrameRate,DWORD *IntTime);
MVCAPI DWORD WINAPI MVC_ContrastAndBrightAdj(DWORD CardNo,PMVCFRAMEINFO FrameInfo,float brightness,float contrast);
MVCAPI DWORD WINAPI MVC_ContrastBrightAndGammaAdj(DWORD CardNo,PMVCFRAMEINFO FrameInfo,float brightness,float contrast);
MVCAPI DWORD WINAPI MVC_InitImgProFun(DWORD ImgWid,DWORD ImgHei,DWORD PixelDepth);
MVCAPI DWORD WINAPI MVC_FiniImgProFun();
MVCAPI DWORD WINAPI MVC_ImgProFun(PMVCFRAMEINFO SrcInfo,BOOL m_bProMode);
MVCAPI DWORD WINAPI MVC_GetDisplayBuffer(DWORD CardNo);
MVCAPI DWORD WINAPI MVC_ConvertStToDBuf(DWORD CardNo,PMVCFRAMEINFO SrcFrameInfo,PMVCFRAMEINFO DstFrameInfo);
MVCAPI DWORD WINAPI MVC_ConvertStToTBuf(DWORD CardNo,PMVCFRAMEINFO SrcFrameInfo,PMVCFRAMEINFO DstFrameInfo);
MVCAPI DWORD WINAPI MVC_ConvertST4To4Buf(DWORD CardNo,PMVCFRAMEINFO FrameInfo,PMVCFRAMEINFO DstFrameInfo);
MVCAPI DWORD WINAPI MVC_QUADGetPGParam(DWORD CardNo,BYTE PulseGenNo,PMVCGE_QUAD_PULSEGENPARAM pPULSEGEN);
MVCAPI DWORD WINAPI MVC_QUADSetPGParam(DWORD CardNo,BYTE PulseGenNo,PMVCGE_QUAD_PULSEGENPARAM pPULSEGEN);
MVCAPI DWORD WINAPI MVC_QUADGetFVALParam(DWORD CardNo,BYTE *m_FVALMode,BOOL *m_EnFVAL,BOOL *m_EnLVAL);
MVCAPI DWORD WINAPI MVC_QUADSetFVALParam(DWORD CardNo,BYTE m_FVALMode,BOOL m_EnFVAL,BOOL m_EnLVAL);
MVCAPI DWORD WINAPI MVC_QUADGetLUTOUTParam(DWORD CardNo,BYTE PulseGenNo,DWORD *pLUTOUT);
MVCAPI DWORD WINAPI MVC_QUADSetLUTOUTParam(DWORD CardNo,BYTE PulseGenNo,DWORD pLUTOUT);
MVCAPI DWORD WINAPI MVC_STControlFlashFun(DWORD CardNo,BYTE FlashID,DWORD Flash1Width,DWORD Flash2Width,DWORD FlashDelay);
MVCAPI DWORD WINAPI MVC_STGetControlFlashFun(DWORD CardNo,BYTE *FlashID,DWORD *Flash1Width,DWORD *Flash2Width,DWORD *FlashDelay);
MVCAPI DWORD WINAPI MVC_EnableAutoExp(DWORD CardNo,BOOL IsEnable,DWORD Interval,RECT m_Rect,DWORD MaxExpTime,DWORD MinExpTime);
MVCAPI DWORD WINAPI MVC_SetWaitGrabSingleFrameTimeOut(DWORD CardNo,DWORD Time);
MVCAPI DWORD WINAPI MVC_GetPicWhiteBalance(DWORD CardNo,PMVCFRAMEINFO RGBFrameInfo,LPRECT WinRect,DWORD *RGain,DWORD *GGain,DWORD *BGain);
MVCAPI DWORD WINAPI MVC_SequenceFrameCapture(DWORD CardNo,LPVOID ImgBuf,DWORD BufSize,DWORD FrameNum,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_GetFrame(DWORD CardNo,PMVCFRAMEINFO FrameInfo);
MVCAPI DWORD WINAPI MVC_SaturateAdj(DWORD CardNo,PMVCFRAMEINFO FrameInfo,long saturation,long colorspace);
MVCAPI DWORD WINAPI MVC_GetAdpater(DWORD Mode,DWORD Num,MVCGE_ADAPTERLIST *AdpList);
MVCAPI DWORD WINAPI MVC_PixelConverterEX(DWORD CardNo,PMVCFRAMEINFO RAWFrameInfo,PMVCFRAMEINFO RGBFrameInfo,BOOL ConverterFlag,BYAERCOLOR_TYPE BayerMode,BOOL m_bIsFlip,BOOL m_bIsMirror,BOOL m_bRotate,BYTE  pRLut[256],BYTE  pGLut[256],BYTE  pBLut[256]);
MVCAPI DWORD WINAPI MVC_GetWhiteBalanceLut(DWORD CardNo,BYTE pRLut[256],BYTE pGLut[256],BYTE pBLut[256]);
MVCAPI DWORD WINAPI MVC_GetPICWhiteBalanceLut(DWORD CardNo,PMVCFRAMEINFO RGBFrameInfo,BYTE pRLut[256],BYTE pGLut[256],BYTE pBLut[256]);
MVCAPI DWORD WINAPI MVC_GetPICWhiteBalanceLutEx(DWORD CardNo,PMVCFRAMEINFO RGBFrameInfo,BYTE pRLut[256],BYTE pGLut[256],BYTE pBLut[256],float brightness,float contrast,float fGammaValue);
MVCAPI DWORD WINAPI MVC_LutConvert(DWORD CardNo,PMVCFRAMEINFO SrcInfo,PMVCFRAMEINFO DstInfo);
MVCAPI DWORD WINAPI MVC_LoadLut(DWORD CardNo,LUT_MODE LutMode,BYTE *LutBuf,DWORD LutBufSize);
MVCAPI DWORD WINAPI MVC_CaptureFrame(DWORD CardNo,PMVCFRAMEINFO FrameInfo,DWORD TimeOut,BOOL bCapWait);
MVCAPI DWORD WINAPI MVC_TriggerCaptureFrame(DWORD CardNo,PMVCFRAMEINFO FrameInfo,BOOL bSoftTriggerCap,DWORD TimeOut,BOOL bCapWait);
MVCAPI DWORD WINAPI MVC_WaitCaptureFrameEvent(DWORD CardNo,DWORD TimeOut);
MVCAPI DWORD WINAPI MVC_SubDisplayInit(DWORD CardNo,DWORD CamNo,RECT rcDest,HWND hWnd,BOOL Bayer3x3);
MVCAPI DWORD WINAPI MVC_SubDisplayDisp(DWORD CardNo,DWORD CamNo,LPBYTE buffer,DWORD ImgWid,DWORD ImgHei);
MVCAPI DWORD WINAPI MVC_SubDisplayClose(DWORD CardNo,DWORD CamNo);
MVCAPI DWORD WINAPI MVC_SubAVIStart(DWORD CardNo,DWORD CamNo,COMPVARS *mCOMPVARS ,char* FileName,DWORD Width,DWORD Height,DWORD PixelBytes,double FrameRate);
MVCAPI DWORD WINAPI MVC_SubAVIStop(DWORD CardNo,DWORD CamNo);
MVCAPI DWORD WINAPI MVC_SubAVICompress(DWORD CardNo,DWORD CamNo,void *aBuffer,DWORD BufSize);
MVCAPI DWORD WINAPI MVC_SequenceFrameCaptureEx(DWORD CardNo,LPVOID ImgBuf,DWORD BufSize,LPDWORD FrameNum,PMVCFRAMEINFO FrameInfo,BOOL bSoftTriggerCap,DWORD TimeOut);
MVCAPI DWORD WINAPI MVC_SetCounter(DWORD CardNo,BYTE CounterNo,PMVCGE_COUNTERPARAM pCounter);
MVCAPI DWORD WINAPI MVC_GetCounter(DWORD CardNo,BYTE CounterNo,PMVCGE_COUNTERPARAM pCounter);
MVCAPI DWORD WINAPI MVC_AutoIPConfig(DWORD CardNo);

#endif